package com.lefevre.cms.bean.theme;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.*;
import java.io.Serializable;

/**
 * 模板目录管理
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("themes")
@Entity
@Table(name = "themes", uniqueConstraints = {
        @UniqueConstraint(columnNames = {"uses"})})
public class Themes implements Serializable {
    private static final long serialVersionUID = -7953037804710631257L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.INPUT)
    private Integer id;

    /**
     * 模板名称
     **/
    private String name;

    /**
     * 模板目录名称
     **/
    @Column(length = 40)
    private String dirName;

    /**
     * 缩略图后缀  图片默认名称：templates
     **/
    @Column(length = 20)
    private String thumbnailSuffix;

    /**
     * 文件名称
     **/
    @Transient
    @TableField(exist = false)
    private String fileName;

    /**
     * 是否使用
     **/
    @Column(nullable = false)
    private Boolean uses = false;

    /**
     * 导航菜单 JSON数据
     **/
    @Lob
    private String columns;

    /**
     * 模板简介
     **/
    @Lob
    private String introduction;

}
